package com.sx.jys.app.framework;

import android.view.View;

import androidx.databinding.BindingAdapter;

import com.sos.widget.util.ViewExtKt;

import kotlin.Unit;
import kotlin.jvm.functions.Function1;

/**
 * @author: YY
 * @time: 2021/6/2
 * @describe View的自定义绑定事件适配
 */
public class viewAdapter {


    /**
     * view的显示隐藏
     */
    @BindingAdapter(value = {"isVisible","isInvisible"}, requireAll = false)
    public static void isVisible(View view,  boolean visibility, boolean isInvisible) {
        if (visibility) {
            view.setVisibility(View.VISIBLE);
        } else {
            view.setVisibility(isInvisible?View.INVISIBLE:View.GONE);
        }
    }
}
